//
//  TheCountdownViewController.m
//  ClassManager
//
//  Created by ihope99 on 2017/8/2.
//  Copyright © 2017年 GZX. All rights reserved.
//

#import "TheCountdownViewController.h"
#import "CountDownModel.h"

@interface TheCountdownViewController (){
    CountDownModel *TheCountDown;
}

@end

@implementation TheCountdownViewController


- (void)viewDidLoad {
    [super viewDidLoad];

    UILabel *mLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 100, kScreenWidth - 20, 40)];
    mLabel.font = [UIFont systemFontOfSize:15.];
    [self.view addSubview:mLabel];
    TheCountDown = [[CountDownModel alloc]init];
    [TheCountDown StartWithEndTimeInterval:100 BOLL:NO Block:^(DownModel *model) {
//        LRLog(@"%02d天%02d时%02d分%02d秒",model.days,model.hours,model.minutes,model.seconds);
        mLabel.text =[NSString stringWithFormat:@"%02d天%02d时%02d分%02d秒",model.days,model.hours,model.minutes,model.seconds];
    }];
    
    UIView *mView = [[UIView alloc]initWithFrame:self.view.bounds];
    mView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:mView];
}

-(void)dealloc{
    [TheCountDown Cancel];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
